<?php if (!empty($customers)) : // ถ้ายังมีรายการ customer ที่ไม่ได้ contract    ?>
    <?php echo $ajax->form('CustomerSupplier', 'post', array('update' => 'content', 'indicator' => 'indicator', 'url' => array('controller' => 'suppliers', 'action' => 'save_customer'))); ?>
    <fieldset>
        <legend>Add new customer</legend>
        <?php echo $this->element('toolbar', array('buttons' => array(array('save' => array('message' => 'Do you want to add this customer to contract list?'))))); ?>
        <?php echo $form->hidden('CustomerSupplier.id'); ?>
        <table>
            <tr>
                <td width="120px"><?php echo $form->label('CustomerSupplier.customer_id', 'Customer', array('class' => 'required')); ?></td>
                <td>
                    <?php echo $form->select('customer_id', $customers); ?>
                    <?php echo $form->hidden('CustomerSupplier.supplier_id', array('value' => $supplier_id)); ?>
                </td>
            </tr>
            <tr>
                <td><?php echo $form->label('CustomerSupplier.has_cust_inventory', 'มีคลังอยู่ที่ลูกค้า'); ?></td>
                <td><?php echo $form->checkbox('CustomerSupplier.has_cust_inventory'); ?> Yes/No</td>
            </tr>
            <tr>
                <td><?php echo $form->label('CustomerSupplier.has_sup_inventory', 'มีคลังอยู่ที่ Vendor'); ?></td>
                <td><?php echo $form->checkbox('CustomerSupplier.has_supplier_inventory'); ?> Yes/No</td>
            </tr>
        </table>
    </fieldset>
    <?php echo $form->end(); ?>
<?php endif; ?>